'use strict';
/**
 * Created by FreezeSoul on 2015/9/22.
 */
define([
        'angular',
        'adConfig',
        'app/modules/editor/define',
        'app/modules/editor/directives/dis-right-click',
        'app/modules/editor/directives/row-selected',
        'css!libs/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css',
    ],
    function (angular, adConfig) {
        angular.module('ad.editor')
            .controller('adEditorController', ['$rootScope', '$scope', 'Notification', function ($rootScope, $scope, Notification) {
                $scope.isShowSidebar = true;
                $scope.switchSidebar = function () {
                    $scope.isShowSidebar = !$scope.isShowSidebar;
                    return false;
                };

                var unbind = $rootScope.$on('ad.appWeb.http.error', function (event, arg) {
                    var url = arg.config.url.replace(adConfig.baseServiceUrl, '');
                    Notification.error('数据服务异常！' + '<br/>Status:' + arg.status + '<br/>URL:' + url);
                });
                $scope.$on('$destroy', unbind);
            }]);
    });